{extends file="../acp.html"}

{block name="title"}{$head_title}{/block}
{block name="content"}
<form action='' method='post' id='add_item_gift' class="bs-docs-example" >
	<div class="tabs clearfix">  
    	<a href="javascript:;" class=" tabs_a active fl" data-origin="discount" data-index="2"><span class="wizardstep-num">1</span>选择商品参与赠送活动</a>  
    	<a href="javascript:;" class="tabs_a fl" data-origin="discount" data-index="1"><span class="wizardstep-num">2</span>添加商品送礼活动</a>
	</div>  
	<!-- end tabs -->  
	<div class="tabs-content" data-origin="discount"> 
	   <div class="tc" data-index="2">
            <div class="tablesWrap tj-all hide">  
    		<div class="tables-searchbox"> 
            	<div class="t-dis-list">
                    <span class="tbs-txt">名称：</span>  
                    <input type="text" name='s_name' id='s_name' value='' />
                </div> 
                <div class="t-dis-list">
                    <div class="formitems inline">  
                        <label class="fi-name" style="width:60px; font-weight:normal;">选择分类：</label>  
                        <div class="form-controls" style=" margin-left:60px;">  
                            <select name="s_category" id='s_category'>
                    			<option value="">--请选择--</option>
                    			{foreach from=$arr_category item=row1}
                				<option value="1.{$row1.class_id}" {if "1."|cat:$row1.class_id EQ $category_id}selected{/if}>{$row1.class_name}</option>
                				{foreach from=$row1.sort_info item=row2}
                				<option value="2.{$row2.class_sort_id}" {if "2."|cat:$row2.class_sort_id EQ $category_id}selected{/if}>{$row2.sort_name}</option>
                				{foreach from=$row2.genre_info item=row3}
                				<option value="3.{$row3.class_genre_id}" {if "3."|cat:$row3.class_genre_id EQ $category_id}selected{/if}>{$row3.genre_name}</option>
                				{/foreach}
                				{/foreach}
                				{/foreach}
                			</select>  
                        </div>  
                    </div>
                </div>
                <div class="t-dis-list">
                    <div class="formitems inline">  
                        <label class="fi-name" style="width:60px; font-weight:normal;">选择品牌：</label>  
                        <div class="form-controls" style=" margin-left:60px;">  
                            <select name="s_brand" id='s_brand'>  
                                <option value="0" selected>--请选择--</option>
                    			{foreach from=$arr_brand item=row}
                    			<option value="{$row.brand_id}">{$row.brand_name}</option>
                    			{/foreach}  
                            </select>  
                        </div>  
                    </div>
                </div>
                <div class="t-dis-list">
                	<span class="tbs-txt">成本价不少于：</span>  
                    <input type="text" name='s_cost_price' id='s_cost_price' class="mini" value='' />
                </div>
                <div class="t-dis-list search"><span class="btn search_item"><i class="gicon-search"></i>查询</span></div>
            </div>  
    		<!-- end tables-searchbox -->  
   			<table class="wxtables">  
                <colgroup>  
                <col width="10%">  
                <col width="10%">  
                <col width="25%">  
                <col width="12%">  
                <col width="12%">  
                <col width="12%">  
                <col width="30%">  
                </colgroup>  
                <thead>  
                    <tr>  
                        <td>选择</td> 
                        <td>商品图</td> 
                        <td>商品名</td>  
                        <td>批发价</td>  
                        <td>活动</td>  
                        <td>活动后(参考)</td>  
                        <td>操作</td>  
                    </tr>  
                </thead>  
                <tbody class='item_list'>
                	<tr><td colspan='7'>暂无商品可选，点击搜索获取商品信息</td></tr>
                </tbody>  
            </table>  
    		<!-- end wxtables -->  
            <div class="tables-btmctrl clearfix">
                <div class="fl select">  
                    <a href="javascript:;" class="btn btn-blue all">全选</a>  
                    <a href="javascript:;" class="btn btn-blue cancel">取消</a>  
                </div>  
                <div class="fr">  
                    <div class="paginate"> 
                    
                    </div>  
                    <!-- end paginate -->  
                </div> 
            </div>  
    		<!-- end tables-btmctrl -->  
		</div>  
		<!-- end tablesWrap --> 
		
        <a type="submit" class="btn btn-blue" onclick='clik()'>选择商品</a>
		<h6>已选择参加活动的商品：</h6>
		<div class="tablesWrap tj-all" style="width:60%;" id='slected_item'>  
   			<table class="wxtables">  
                <colgroup>  
                <col width="10%">  
                <col width="55%">  
                <col width="10%"> 
                <col width="15%">  
                </colgroup>  
                <thead>  
                    <tr>   
                        <td>商品图</td> 
                        <td>商品名</td>  
                        <td>批发价</td>   
                        <td>操作</td> 
                    </tr>  
                </thead>  
                <tbody class='item_list'>
                    <tr class='no_one'><td colspan='4'>暂无商品可选，点击搜索获取商品信息</td></tr>
                </tbody>  
            </table>  
    		<!-- end wxtables -->  
		</div>
		<a href="javascript:;" id="jump1" class="btn btn-blue">下一步</a>
        
        </div>
	   <div class="tc hide"  data-index="1"> 
	    	<div class="formitems inline">  
	            <label class="fi-name">活动类型：</label>  
	            <div class="form-controls" style="line-height:32px;">指定商品送礼品</div>  
	        </div>
	        <div class="formitems inline type">  
		            <label class="fi-name"><span class="colorRed">*</span>需要购买多少件商品：</label>  
		            <div class="form-controls">
		             	<input type="text" name='i_total' placeholder="" value='1' class="mini">
		                <span class="fi-help-text">请填写数字(达到购买数量时进行赠送，默认为1件)</span>   
		            </div>  
		    </div>
	        <div class="formitems inline">  
    			<label class="fi-name"><span class="colorRed">*</span>选择要赠送的礼品：</label>  
    			<div class="form-controls">
    				{if $gift_list}  
        			<select name="gift">
        				<option value selected>--请选择--</option>
            			{section name='row' loop=$gift_list}
            			<option value="{$gift_list[row].gift_id}">{$gift_list[row].gift_name}</option>
            			{/section}
        			</select>
        			<span class="fi-help-text">选择一件礼品</span> 
        			{else}
            			您还没有可赠送的礼品	
            		{/if}  
    			</div>  
			</div>
			<div class="formitems inline type">  
		            <label class="fi-name"><span class="colorRed">*</span>赠送件数：</label>  
		            <div class="form-controls">
		             	<input type="text" name='g_total' placeholder="" value='1' class="mini">
		                <span class="fi-help-text">请填写一个正整数(该礼品赠送多少件,默认为1件)</span>   
		            </div>  
		    </div>
	        <div class="formitems inline">  
	            <label class="fi-name"><span class="colorRed"></span>开始日期：</label>  
	            <div class="form-controls">  
	                <input type="text" autocomplete="off" class="Wdate" name='time1' onclick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm'})">  
	                <span class="fi-help-text">只有达到开始日期，活动才会生效。若不指定开始时间，则表示活动即可生效</span>  
	            </div>  
	        </div> 
	        <div class="formitems inline">  
	            <label class="fi-name"><span class="colorRed"></span>结束日期：</label>  
	            <div class="form-controls">  
	                <input type="text" autocomplete="off" class="Wdate" name='time2' onclick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm'})">  
	                <span class="fi-help-text">当达到结束日期时，活动会结束。若不指定结束时间，则表示活动长期有效</span>  
	            </div>  
	        </div>  
	        <div class="formitems inline">  
		            <label class="fi-name"><span class="colorRed"></span>活动是否启用：</label>  
		            <div class="radio-group">  
            			<label><input type="radio" name="used" value='1' checked>是</label>  
            			<label><input type="radio" name="used" value='2'>否</label> 
        			</div>  
        			<span class="fi-help-text"></span> 
		        </div>
	        <div class="formitems inline"> 
		        	<label class="fi-name">&nbsp;</label> 
		        	<div class="radio-group">
		        		<input type='hidden' name='act' value='add' />
        				<button type="submit" class="btn btn-blue">提交</button>
		        	</div>
		    </div> 
	    </div>  
	</div>
</form> 
<!-- end tabs-content -->  

<script>
  	var item_arr = new Array();
</script>
{/block} 

{block name="js"}
<script src="/Public/Plugins/My97DatePicker/WdatePicker.js"></script>
<script src="__ACPJS__/AcpPromo/add_item_gift.js"></script>
{/block} 

{block name="css"}
<link rel="stylesheet" href="/Public/Css/acp/AcpPromo/add_list_item_discount.css" />
{/block}